<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('https://www.ljwsyt.xyz').hostname,
    root: '/',
    scheme: 'Mist',
    version: '7.6.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":true,"show_result":true,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":true,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":true,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: '',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="鉴于习惯性和先入为主的惯性思维方式，这里由简到繁，由新到旧进行说明。 1. 使用Set">
<meta property="og:type" content="article">
<meta property="og:title" content="数组去重详解">
<meta property="og:url" content="https://www.ljwsyt.xyz/2020/01/02/%E6%95%B0%E7%BB%84%E5%8E%BB%E9%87%8D%E8%AF%A6%E8%A7%A3/index.html">
<meta property="og:site_name" content="MrLi&#39;s Blog">
<meta property="og:description" content="鉴于习惯性和先入为主的惯性思维方式，这里由简到繁，由新到旧进行说明。 1. 使用Set">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-01-02T00:53:25.000Z">
<meta property="article:modified_time" content="2020-01-02T02:36:54.038Z">
<meta property="article:author" content="Li Jiawei">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://www.ljwsyt.xyz/2020/01/02/%E6%95%B0%E7%BB%84%E5%8E%BB%E9%87%8D%E8%AF%A6%E8%A7%A3/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>数组去重详解 | MrLi's Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

  <link rel="stylesheet" type="text/css" href="https://files.cnblogs.com/files/ljwsyt/hBlogs.css">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta custom-logo">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">MrLi's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类<span class="badge">0</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档<span class="badge">3</span></a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <a href="https://github.com/MRlijiawei" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://www.ljwsyt.xyz/2020/01/02/%E6%95%B0%E7%BB%84%E5%8E%BB%E9%87%8D%E8%AF%A6%E8%A7%A3/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Li Jiawei">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="MrLi's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          数组去重详解
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-01-02 08:53:25 / 修改时间：10:36:54" itemprop="dateCreated datePublished" datetime="2020-01-02T08:53:25+08:00">2020-01-02</time>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>  鉴于习惯性和先入为主的惯性思维方式，这里由简到繁，由新到旧进行说明。</p>
<h2 id="1-使用Set"><a href="#1-使用Set" class="headerlink" title="1. 使用Set"></a>1. 使用Set</h2><a id="more"></a>
<p>  Set结构是ES6新增的特性，其主要特点就是不重复，因而说到去重第一个想到的就是使用Set。过程呢也很简单，就是使用原始数组构造Set，再用这个Set生成新的数组：<br>  <code>let distinct = (arr) =&gt; [...new Set(arr)]</code></p>
<h2 id="2-使用Object键值对"><a href="#2-使用Object键值对" class="headerlink" title="2. 使用Object键值对"></a>2. 使用Object键值对</h2><p>  这个思路也很清晰，利用对象中没有重复的属性的这一特性。<br>  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">let distinct &#x3D; (arr) &#x3D;&gt; &#123;</span><br><span class="line">  var obj &#x3D; &#123;&#125;</span><br><span class="line">  return arr.filter(item &#x3D;&gt; &#123;</span><br><span class="line">    return obj.hasOwnProperty(typeof item + item) ? false : (obj[typeof item + item] &#x3D; true)</span><br><span class="line">  &#125;)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><br>  这里使用元素的typeof是为了避免比如数组中有1和’1’导致被过滤掉的场景。</p>
<h2 id="3-使用sort-一次冒泡"><a href="#3-使用sort-一次冒泡" class="headerlink" title="3. 使用sort+一次冒泡"></a>3. 使用sort+一次冒泡</h2><p>  先进行一遍排序，然后比较相邻元素是否相同。<br>  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">let distinct &#x3D; (arr) &#x3D;&gt; &#123;</span><br><span class="line">  var res &#x3D; []</span><br><span class="line">  var sortArr &#x3D; arr.sort()&#x2F;&#x2F; 网上有人使用arr.concat().sort()，不解，知道的大佬可以留言</span><br><span class="line">  var cur</span><br><span class="line">  for(var i&#x3D;0,len&#x3D;sortArr.length;i&lt;len;i++) &#123;</span><br><span class="line">    if (!i || cur !&#x3D;&#x3D; sortArr[i]) &#123;</span><br><span class="line">      res.push(sortArr[i])</span><br><span class="line">    &#125;</span><br><span class="line">    cur &#x3D; sortArr[i]</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="4-filter-indexOf"><a href="#4-filter-indexOf" class="headerlink" title="4. filter+indexOf"></a>4. filter+indexOf</h2><p>  即判断元素的index是否和indexOf的index（第一次出现的位置）相等，如果不相等，说明不是第一次出现，是重复的<br>  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">let distinct &#x3D; (arr) &#x3D;&gt; &#123;</span><br><span class="line">  return arr.filter((item, index) &#x3D;&gt; &#123;</span><br><span class="line">    return arr.indexOf(item) &#x3D;&#x3D;&#x3D; index</span><br><span class="line">  &#125;)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="5-双重for循环"><a href="#5-双重for循环" class="headerlink" title="5. 双重for循环"></a>5. 双重for循环</h2><p>  这个是最古老最底层的方法，循环内的处理又有两种，一种是新建空数组push，一种是在原数组的基础上splice。以后者为例：<br>  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">let distinct &#x3D; (arr) &#x3D;&gt; &#123;</span><br><span class="line">  for(let i&#x3D;0,len&#x3D;arr.length;i&lt;len;i++) &#123;</span><br><span class="line">    for(let j&#x3D;i+1;j&lt;len;j++) &#123;</span><br><span class="line">      if (arr[i] &#x3D;&#x3D;&#x3D; arr[j]) &#123;</span><br><span class="line">        arr.splice(j, 1)</span><br><span class="line">        len--</span><br><span class="line">        j--</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">  return arr</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><br>  splice后数组长度会变短，所以这里len和j都需要-1。</p>
<h2 id="对比"><a href="#对比" class="headerlink" title="对比"></a>对比</h2><h3 id="代码复杂度"><a href="#代码复杂度" class="headerlink" title="代码复杂度"></a>代码复杂度</h3><p>  无疑是Set结构的最简单，其次是Object和filter，接下来就是for和sort。</p>
<h3 id="时间复杂度"><a href="#时间复杂度" class="headerlink" title="时间复杂度"></a>时间复杂度</h3><p>  我们知道filter，forEach等遍历和for循环一样，他们的时间复杂度是O(n)，indexOf也是进行一次遍历查找，只是不会全部查找，而是查找到后就会停止，时间复杂度也是O(n)，但用时平均为一半。sort()的复杂度也是O(n)，在数据少的时候使用的是快排，数据多的时候使用的是插入排序。<br>  因而，双重for和filter+indexOf是O(n^2)，其次是sort()+冒泡，再次是Set和Object。放到实际生产环境中，最终用时跟数据量等也有很大的关系。至于两个双重for和Set与Object的效率对比，个人认为filter+indexOf比双重for快一点，因为indexOf不是全部遍历，虽然双重for由于有重复时长度最终会变短；Set和Object，Set会进行两次类似遍历的依次处理，Object会进行属性查找，具体谁快谁慢不太好确定，但一般会比另外一种方法快。</p>
<h3 id="空间复杂度"><a href="#空间复杂度" class="headerlink" title="空间复杂度"></a>空间复杂度</h3><p>  3在处理过程中新增的的局部变量较多，空间复杂度最高，1和2在处理过程中会产生新的数据结构Set和Object次之，5和4最低。</p>
<h3 id="兼容性和准确性"><a href="#兼容性和准确性" class="headerlink" title="兼容性和准确性"></a>兼容性和准确性</h3><p>  对于一些特殊的数据比如1和’1’，对象，NaN等，Object键值对方法可以完全去重，Set可以使NaN去重，但是对象无法去重，其他几种方法对对象和NaN也基本无法去重，甚至filter+indexOf会忽略NaN。当然，在实际使用的时候，在去重之前我们肯定会对一些非法数据进行去重，也会保证要处理的数据是正确的数组，因而准确性可以得到有效保证。当然还有别的第三方库如lodash等也都可以实现高效准确的去重。</p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/2019/12/31/%E5%8D%9A%E5%AE%A2%E8%AE%BE%E7%BD%AE/" rel="next" title="博客设置">
      博客设置 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-使用Set"><span class="nav-number">1.</span> <span class="nav-text">1. 使用Set</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-使用Object键值对"><span class="nav-number">2.</span> <span class="nav-text">2. 使用Object键值对</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-使用sort-一次冒泡"><span class="nav-number">3.</span> <span class="nav-text">3. 使用sort+一次冒泡</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-filter-indexOf"><span class="nav-number">4.</span> <span class="nav-text">4. filter+indexOf</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-双重for循环"><span class="nav-number">5.</span> <span class="nav-text">5. 双重for循环</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#对比"><span class="nav-number">6.</span> <span class="nav-text">对比</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#代码复杂度"><span class="nav-number">6.1.</span> <span class="nav-text">代码复杂度</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#时间复杂度"><span class="nav-number">6.2.</span> <span class="nav-text">时间复杂度</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#空间复杂度"><span class="nav-number">6.3.</span> <span class="nav-text">空间复杂度</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#兼容性和准确性"><span class="nav-number">6.4.</span> <span class="nav-text">兼容性和准确性</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Li Jiawei"
      src="/images/avatar.gif">
  <p class="site-author-name" itemprop="name">Li Jiawei</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">3</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/MRlijiawei" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;MRlijiawei" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:lijwsunyt@qq.com" title="E-Mail → mailto:lijwsunyt@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://www.cnblogs.com/ljwsyt" title="https:&#x2F;&#x2F;www.cnblogs.com&#x2F;ljwsyt" rel="noopener" target="_blank">cnblogs</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        
  <div class="beian"><a href="http://www.beian.miit.gov.cn/" rel="noopener" target="_blank">备案进行中 </a>
  </div>

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heartbeat"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Li Jiawei</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>




  
  <script>
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>













<script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdnjs.cloudflare.com/ajax/libs/mermaid/8.3.0/mermaid.min.js', () => {
    mermaid.initialize({
      theme: 'forest',
      logLevel: 3,
      flowchart: { curve: 'linear' },
      gantt: { axisFormat: '%m/%d/%Y' },
      sequence: { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script>


  

  

</body>
</html>
